<?php

include_once "accesscontrol.php";
include_once "../conn.php";

$ename = $_SESSION['ename'];

//
// Start retrive data from database
//
$q1 = "SELECT * FROM `job_view` WHERE ename = '$ename' ";
$r1 = mysql_query($q1) or die(mysql_error());

//
// Check result return 
//
if (mysql_num_rows($r1) > '0'){

while($a1 = mysql_fetch_array($r1)){

$q2 = "SELECT * FROM job_seeker_info WHERE uname = '$a1[uname]' ";
$r2 = mysql_query($q2) or die(mysql_error());
$a2 = mysql_fetch_array($r2);

$del  = "<a class=TNA href=\"delete_record.php?uname=$a2[uname]&ename=$ename\">Delete</a>";

//
// Check status of view resume
//
if($a1['status'] == 'y'){
	$view = "<a class=TNA href=\"EmployerView.php?uname=$a2[uname]\"><font color=blue>View</font></a>";
}
else if($a1['status'] == 'n'){
	$view = "<font color = red>Rejected</font>";
}
else if($a1['status'] == 'p'){
	$view = "Pending";
}

$cl = career_level("", $a2[careerlevel]);

//
// Display list of jobseekers that have been requested
//
echo "<span class=HeaderClass>View Resume</span><br><br>";

echo "<br><table align=center width=460 cellspacing=0 border=1 bordercolor=black class=BlackText>
		<tr>
		<td>Name:</td><td bgcolor=dddddd> $a2[fname] $a2[lname]</td>
		$view  |  $del
		</tr>

		<tr><td>Career level: </td>
		<td bgcolor=dddddd> $cl</td></tr>
		<tr>
		<td width=100 valign=top>Prefered jobs:</td>
		<td bgcolor=dddddd>
		$a2[job_category] 
		</td>
		</tr>
		</table>
		";
	}
}
else {
	echo "<center><br><br><br><br><span class=TNA> You don't have request to view any resume.</span></center>";
}

?>